import 'package:flutter/material.dart';

void main() => runApp(MyApp());

/// 按钮
class MyApp extends StatelessWidget {
  Widget _bulidBody() {
    return SingleChildScrollView(
      child: Column(
        children: [
          BackButton(
            color: Colors.orange,
            onPressed: () => {print('BackButton')},
          ),
          TextButton(
            onPressed: () => {print('TextButton')},
            child: Text('扁平按钮'),
          ),
          TextButton.icon(
            onPressed: () => {},
            icon: Icon(
              Icons.access_time,
              size: 18.0,
            ),
            label: Text('扁平按钮带图标'),
          ),
          OutlinedButton(
            onPressed: () => {},
            child: Text('带框的按钮'),
          ),
          OutlinedButton.icon(
            onPressed: () => {},
            icon: Icon(Icons.accessibility),
            label: Text('带框图标按钮'),
          ),
          ElevatedButton(
            child: Text('立体按钮'),
            onPressed: () => {},
          ),
          ElevatedButton.icon(
            onPressed: null,
            icon: Icon(
              Icons.account_box,
              size: 18.0,
            ),
            label: Text('立体按钮带图标'),
          ),
          MaterialButton(
            onPressed: null,
            child: Text('Material按钮'),
          ),
          RawMaterialButton(
            onPressed: null,
            child: Text('RawMaterial按钮'),
          ),
          FloatingActionButton(
            onPressed: null,
            child: Icon(
              Icons.accessibility,
            ),
          ),
        ],
      ),
    );
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Material App',
      home: Scaffold(
        appBar: AppBar(
          title: Text('Material App Bar'),
        ),
        body: _bulidBody(),
        floatingActionButton: FloatingActionButton(
          onPressed: null,
          child: Icon(
            Icons.accessibility,
          ),
        ),
      ),
    );
  }
}
